/**
 * 语言初始化
 */
import { setLocale } from 'umi';
import moment from 'moment';
import storejs from 'storejs';
import 'moment/locale/zh-cn';

export function setLocaleFunc (locale){
    window.locale = locale
    moment.locale(locale.toLowerCase());
    setTimeout(()=>{
        setLocale(locale)
    },50)
}

var locale = storejs('locale') || 'zh-CN';
setLocaleFunc(locale)